﻿
CREATE FUNCTION dbo.RegistryValue
(@Name varchar(128))
RETURNS varchar(8000) WITH SCHEMABINDING BEGIN 

DECLARE @Ret varchar(8000)

SELECT @Ret = [Value] FROM dbo.t_Registry WHERE [Name] = @Name

IF @@ROWCOUNT = 0
BEGIN
--	RAISERROR ('Value with name:%s not found.', 16, 1,@Name)
	RETURN NULL
END

RETURN @Ret

END